//////////////////////////////////////////
//
//	FlexInc. 2011
//	http://www.loziosecchi.it/flex_inc
//	http://twitter.com/loziosecchi
//
//////////////////////////////////////////

package flexInc.spark.effects
{
	import spark.effects.easing.Bounce;
	import spark.effects.easing.Elastic;
	import spark.effects.easing.IEaser;
	import spark.effects.easing.Linear;
	import spark.effects.easing.Power;
	import spark.effects.easing.Sine;

	/**
	 * The EaserUtils is a utility class used
	 * to get easer instances depending on a string
	 * type.
	 */
	public class EaserUtils
	{
		/**
		 *  The sine ease type
		 */
		public static const EASE_SINE:String = "sine";

		/**
		 *  The bounce ease type
		 */
		public static const EASE_BOUNCE:String = "bounce";

		/**
		 *  The elastic ease type
		 */
		public static const EASE_ELASTIC:String = "elastic";

		/**
		 *  The linear ease type
		 */
		public static const EASE_LINEAR:String = "linear";

		/**
		 *  The power ease type
		 */
		public static const EASE_POWER:String = "power";

		/**
		 * Returns an easer depending on the passed type
		 */
		public static function getEaser(type:String):IEaser
		{
			var easer:IEaser;
			
			switch(type)
			{
				case EASE_BOUNCE:
					easer = new Bounce();
					break;
				case EASE_ELASTIC:
					easer = new Elastic();
					break;
				case EASE_LINEAR:
					easer = new Linear();
					break;
				case EASE_POWER:
					easer = new Power();
					break;
				default:
					easer = new Sine();
					break;
			}
			
			return easer;
		}
	}
}